home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-26 | 929 b | 39 lines | [TEXT/CWIE] |
-
- // mail <chelly@eden.com> or surf http://www.eden.com/~chelly for feedback
- // free source code - do whatever you like with it
-
- // uniform access to offscreen pixels on both mac and windows
-
- #define CINTERFACE
-
- #include "GEOffscreen.h"
-
- #if TARGET_IS_MACOS
-
- GEOffscreenInfo GetGEOffscreenInfo( GWorldPtr gw )
- {
- GEOffscreenInfo info;
- PixMapHandle const pm = GetGWorldPixMap( gw );
- info.baseAddr = GetPixBaseAddr( pm );
- info.rowBytes = (**pm).rowBytes & 0x3FFF;
- info.bounds = (**pm).bounds;
- OffsetRect( &info.bounds, -info.bounds.left, -info.bounds.top );
- return info;
- }
-
- #elif TARGET_IS_WIN95
-
- GEOffscreenInfo GetGEOffscreenInfo( GWorldPtr gw )
- {
- GEOffscreenInfo info;
- PixMapHandle const pm = GetGWorldPixMap( gw );
- info.baseAddr = (char *) pm->bmBits;
- info.rowBytes = pm->bmInfo.bmiHeader.biWidth;
- info.bounds = gw->portRect;
- OffsetRect( &info.bounds, -info.bounds.left, -info.bounds.top );
- return info;
- }
-
- #endif
-
-